package com.yazi.mxz.common.entity.beans;

import com.myframework.smhj.hibernate.Entity;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

/**
 * StorePromote entity. @author MyEclipse Persistence Tools
 */
@javax.persistence.Entity
@Table(name = "MXZ_STORE_PROMOTE", schema = "MXZ")
public class StorePromote extends Entity implements java.io.Serializable {

	// Fields

	private Long promoteId;
	private Category category;
	private Store store;
	private Long startTime;
	private Long endTime;
	private Integer status;
	private Integer type;
	private String name;
	private Float cost;
	private Float back;
	private Boolean isAnalogy;
	private Float analogyCost;
	private Float analogyBack;
	private Boolean autoOut;
	private Long addTime;
	private Long updateTime;
	private Set<StoreGift> storeGifts = new HashSet<StoreGift>(0);

	// Constructors

	/** default constructor */
	public StorePromote() {
	}

	/** minimal constructor */
	public StorePromote(Store store, Long startTime, Long endTime,
			Integer status, Integer type, String name, Float cost, Float back,
			Boolean isAnalogy, Float analogyCost, Float analogyBack,
			Boolean autoOut, Long addTime, Long updateTime) {
		this.store = store;
		this.startTime = startTime;
		this.endTime = endTime;
		this.status = status;
		this.type = type;
		this.name = name;
		this.cost = cost;
		this.back = back;
		this.isAnalogy = isAnalogy;
		this.analogyCost = analogyCost;
		this.analogyBack = analogyBack;
		this.autoOut = autoOut;
		this.addTime = addTime;
		this.updateTime = updateTime;
	}

	/** full constructor */
	public StorePromote(Category category, Store store, Long startTime,
			Long endTime, Integer status, Integer type, String name,
			Float cost, Float back, Boolean isAnalogy, Float analogyCost,
			Float analogyBack, Boolean autoOut, Long addTime, Long updateTime,
			Set<StoreGift> storeGifts) {
		this.category = category;
		this.store = store;
		this.startTime = startTime;
		this.endTime = endTime;
		this.status = status;
		this.type = type;
		this.name = name;
		this.cost = cost;
		this.back = back;
		this.isAnalogy = isAnalogy;
		this.analogyCost = analogyCost;
		this.analogyBack = analogyBack;
		this.autoOut = autoOut;
		this.addTime = addTime;
		this.updateTime = updateTime;
		this.storeGifts = storeGifts;
	}

	// Property accessors
	@SequenceGenerator(name = "generator", sequenceName = "SEQ_STORE_PROMOTE")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "PROMOTE_ID", unique = true, nullable = false, precision = 15, scale = 0)
	public Long getPromoteId() {
		return this.promoteId;
	}

	public void setPromoteId(Long promoteId) {
		this.promoteId = promoteId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CAT_ID")
	public Category getCategory() {
		return this.category;
	}

	public void setCategory(Category category) {
		this.category = category;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STORE_ID", nullable = false)
	public Store getStore() {
		return this.store;
	}

	public void setStore(Store store) {
		this.store = store;
	}

	@Column(name = "START_TIME", nullable = false, precision = 15, scale = 0)
	public Long getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Long startTime) {
		this.startTime = startTime;
	}

	@Column(name = "END_TIME", nullable = false, precision = 15, scale = 0)
	public Long getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Long endTime) {
		this.endTime = endTime;
	}

	@Column(name = "STATUS", nullable = false, precision = 8, scale = 0)
	public Integer getStatus() {
		return this.status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	@Column(name = "TYPE", nullable = false, precision = 8, scale = 0)
	public Integer getType() {
		return this.type;
	}

	public void setType(Integer type) {
		this.type = type;
	}

	@Column(name = "NAME", nullable = false, length = 250)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "COST", nullable = false, precision = 8)
	public Float getCost() {
		return this.cost;
	}

	public void setCost(Float cost) {
		this.cost = cost;
	}

	@Column(name = "BACK", nullable = false, precision = 8)
	public Float getBack() {
		return this.back;
	}

	public void setBack(Float back) {
		this.back = back;
	}

	@Column(name = "IS_ANALOGY", nullable = false, precision = 1, scale = 0)
	public Boolean getIsAnalogy() {
		return this.isAnalogy;
	}

	public void setIsAnalogy(Boolean isAnalogy) {
		this.isAnalogy = isAnalogy;
	}

	@Column(name = "ANALOGY_COST", nullable = false, precision = 8)
	public Float getAnalogyCost() {
		return this.analogyCost;
	}

	public void setAnalogyCost(Float analogyCost) {
		this.analogyCost = analogyCost;
	}

	@Column(name = "ANALOGY_BACK", nullable = false, precision = 8)
	public Float getAnalogyBack() {
		return this.analogyBack;
	}

	public void setAnalogyBack(Float analogyBack) {
		this.analogyBack = analogyBack;
	}

	@Column(name = "AUTO_OUT", nullable = false, precision = 1, scale = 0)
	public Boolean getAutoOut() {
		return this.autoOut;
	}

	public void setAutoOut(Boolean autoOut) {
		this.autoOut = autoOut;
	}

	@Column(name = "ADD_TIME", nullable = false, precision = 15, scale = 0)
	public Long getAddTime() {
		return this.addTime;
	}

	public void setAddTime(Long addTime) {
		this.addTime = addTime;
	}

	@Column(name = "UPDATE_TIME", nullable = false, precision = 15, scale = 0)
	public Long getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Long updateTime) {
		this.updateTime = updateTime;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "storePromote")
	public Set<StoreGift> getStoreGifts() {
		return this.storeGifts;
	}

	public void setStoreGifts(Set<StoreGift> storeGifts) {
		this.storeGifts = storeGifts;
	}

}